package itdep.domain.student;

import itdep.domain.IisEntity;
import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;

import javax.persistence.*;

/**
 * @author Mari
 * @version $Revision: 16 $ $Date: 2010-06-16 15:22:40 +0000 (Wed, 16 Jun 2010) $
 */
@Entity
@Table(name = "STUDENT_USER_MARK")
public class UserMark extends IisEntity {
	/**
	 * Use @ManyToOne to mapping student and type
	 */
	@ManyToOne
	@JoinColumn(name = "ID_STUDENT", nullable = false)
	private Student student;

	@Type(type = "ga.hibernate.OrderedEnumUserType", parameters = {@Parameter(name = "enumClass", value = "itdep.domain.student.UserMarkType")})
	@Column(name = "USER_MARK_TYPE", nullable = false)
	private UserMarkType type;

	/**
	 * Just user comment for student
	 */
	@Column(name = "COMMENT", nullable = true)
	private String comment;

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	public UserMarkType getType() {
		return type;
	}

	public void setType(UserMarkType type) {
		this.type = type;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
}